<template>
  <div>
    <el-select v-model.trim="form.fieldCode"  @change="selectResChange" placeholder="请选择场所">
     <el-option v-for="dict in selectBaseFieldInfoList" :key="dict.value" :label="dict.value+'-'+dict.label" :value="dict.value" />
    </el-select>
  </div>
</template>

<script>
 import {findBaseFieldInfo} from "@/api/system/baseFieldInfo";
export default {
  name: "selectCustoms",
  props: {
    customsCode: {
      type: String,
      default: ""
    }
  },
  data() {
    return {
      form: {
        fieldCode: "",
      },
      selectBaseFieldInfoList: [],
    };
  },
  watch: {
    customsCode: {
      immediate: true,
      handler(val) {
        if(val) {
          //this.form.queryCodeTs = val;
        }
      }
    }
  },
  //初始化完成的时候加载下来数据
  mounted(){
    this.getList();
  },
  methods: {
    selectResChange(val) {
      this.$emit("selectResHandler", val)
    },
    getList() {
     findBaseFieldInfo({customsCode:this.customsCode}).then(response => {
       this.selectBaseFieldInfoList = response.data;
     })
    },
  },
};
</script>

<style lang="scss" scoped>
.search-box {
  width: 100%;
  margin: 10px 0px;
  ::v-deep .el-form-item {
    width: 30%;
  }
}
::v-deep .el-dialog__body {
  padding: 10px 20px;
}
.dialog-footer {
  text-align: center;
}
</style>
